import { useEffect, useRef } from "react"


function App() {
  
  const inputRef = useRef<HTMLInputElement>(null)
  const timer = useRef<number | undefined>(undefined)

  useEffect(() => {
    inputRef.current?.focus()

    timer.current = setInterval(() => {
      console.log('11')
    }, 1000)

    return () => {
      clearInterval(timer.current)
    }

  }, [])

  return (
    <>
      <input type="text" ref={inputRef} />
    </>
  )
}

export default App
